package reactor

import (
	"math/rand"
	"strconv"
	"time"
)

type event struct {
	name string
}

type acceptor struct {
	ch chan *event
}

type processor struct {
	duration time.Duration
	result   string
}

func run() {

	events := generateEvents()
	ch := &acceptor{ch: make(chan *event)}
	for e := range events {
		ch.ch <- &e
	}

}

var ticker = time.Tick(time.Second)

func generateEvents() chan event {
	ch := make(chan event)
	go func() {
		<-ticker
		ch <- event{name: strconv.Itoa(rand.Int())}
	}()
	return ch

}
